package org.framework.edge.builder.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.wu.framework.web.spring.EasyController;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import jakarta.annotation.Resource;
import java.util.List;
import org.framework.edge.builder.domain.model.docker.builder.DockerBuilder;
import org.framework.edge.builder.application.command.docker.builder.DockerBuilderRemoveCommand;
import org.framework.edge.builder.application.command.docker.builder.DockerBuilderStoryCommand;
import org.framework.edge.builder.application.command.docker.builder.DockerBuilderUpdateCommand;
import org.framework.edge.builder.application.command.docker.builder.DockerBuilderQueryListCommand;
import org.framework.edge.builder.application.command.docker.builder.DockerBuilderQueryOneCommand;
import org.framework.edge.builder.application.DockerBuilderApplication;
import org.framework.edge.builder.application.dto.DockerBuilderDTO;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
import org.framework.edge.builder.application.command.docker.builder.DockerBuilderExcelExport;
import org.framework.edge.builder.application.command.docker.builder.DockerBuilderExcelImport;
import org.wu.framework.easy.excel.stereotype.RequestExcelBody;
import org.wu.framework.easy.excel.stereotype.EasyExcel;
/**
 * describe docker 打包 
 *
 * @author Jia wei Wu
 * @date 2025/07/08 06:06 晚上
 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController 
 **/
@Tag(name = "docker 打包提供者")
@EasyController("/docker/builder")
public class DockerBuilderProvider  {

    @Resource
    private DockerBuilderApplication dockerBuilderApplication;

    /**
     * describe 新增docker 打包
     *
     * @param dockerBuilderStoryCommand 新增docker 打包     
     * @return {@link Result<DockerBuilder>} docker 打包新增后领域对象     
     
     * @author Jia wei Wu
     * @date 2025/07/08 06:06 晚上
     **/

    @Operation(summary = "新增docker 打包")
    @PostMapping("/story")
    public Result<DockerBuilder> story(@RequestBody DockerBuilderStoryCommand dockerBuilderStoryCommand){
        return dockerBuilderApplication.story(dockerBuilderStoryCommand);
    }
    /**
     * describe 批量新增docker 打包
     *
     * @param dockerBuilderStoryCommandList 批量新增docker 打包     
     * @return {@link Result<List<DockerBuilder>>} docker 打包新增后领域对象集合     
     
     * @author Jia wei Wu
     * @date 2025/07/08 06:06 晚上
     **/

    @Operation(summary = "批量新增docker 打包")
    @PostMapping("/batchStory")
    public Result<List<DockerBuilder>> batchStory(@RequestBody List<DockerBuilderStoryCommand> dockerBuilderStoryCommandList){
        return dockerBuilderApplication.batchStory(dockerBuilderStoryCommandList);
    }
    /**
     * describe 更新docker 打包
     *
     * @param dockerBuilderUpdateCommand 更新docker 打包     
     * @return {@link Result<DockerBuilder>} docker 打包领域对象     
     
     * @author Jia wei Wu
     * @date 2025/07/08 06:06 晚上
     **/

    @Operation(summary = "更新docker 打包")
    @PutMapping("/updateOne")
    public Result<DockerBuilder> updateOne(@RequestBody DockerBuilderUpdateCommand dockerBuilderUpdateCommand){
        return dockerBuilderApplication.updateOne(dockerBuilderUpdateCommand);
    }
    /**
     * describe 查询单个docker 打包
     *
     * @param dockerBuilderQueryOneCommand 查询单个docker 打包     
     * @return {@link Result<DockerBuilderDTO>} docker 打包DTO对象     
     
     * @author Jia wei Wu
     * @date 2025/07/08 06:06 晚上
     **/

    @Operation(summary = "查询单个docker 打包")
    @GetMapping("/findOne")
    public Result<DockerBuilderDTO> findOne(@ModelAttribute DockerBuilderQueryOneCommand dockerBuilderQueryOneCommand){
        return dockerBuilderApplication.findOne(dockerBuilderQueryOneCommand);
    }
    /**
     * describe 查询多个docker 打包
     *
     * @param dockerBuilderQueryListCommand 查询多个docker 打包     
     * @return {@link Result<List<DockerBuilderDTO>>} docker 打包DTO对象     
     
     * @author Jia wei Wu
     * @date 2025/07/08 06:06 晚上
     **/

    @Operation(summary = "查询多个docker 打包")
    @GetMapping("/findList")
    public Result<List<DockerBuilderDTO>> findList(@ModelAttribute DockerBuilderQueryListCommand dockerBuilderQueryListCommand){
        return dockerBuilderApplication.findList(dockerBuilderQueryListCommand);
    }
    /**
     * describe 分页查询多个docker 打包
     *
     * @param dockerBuilderQueryListCommand 分页查询多个docker 打包     
     * @return {@link Result<LazyPage<DockerBuilderDTO>>} 分页docker 打包DTO对象     
     
     * @author Jia wei Wu
     * @date 2025/07/08 06:06 晚上
     **/

    @Operation(summary = "分页查询多个docker 打包")
    @GetMapping("/findPage")
    public Result<LazyPage<DockerBuilderDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
                           @Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current,@ModelAttribute DockerBuilderQueryListCommand dockerBuilderQueryListCommand){
        return dockerBuilderApplication.findPage(size,current,dockerBuilderQueryListCommand);
    }
    /**
     * describe 删除docker 打包
     *
     * @param dockerBuilderRemoveCommand 删除docker 打包     
     * @return {@link Result<DockerBuilder>} docker 打包     
     
     * @author Jia wei Wu
     * @date 2025/07/08 06:06 晚上
     **/

    @Operation(summary = "删除docker 打包")
    @DeleteMapping("/remove")
    public Result<DockerBuilder> remove(@ModelAttribute DockerBuilderRemoveCommand dockerBuilderRemoveCommand){
        return dockerBuilderApplication.remove(dockerBuilderRemoveCommand);
    }
    /**
     * describe 导出docker 打包
     *
     * @param dockerBuilderQueryListCommand 导出docker 打包     
     * @return {@link List<DockerBuilderExcelExport>} docker 打包     
     
     * @author Jia wei Wu
     * @date 2025/07/08 06:06 晚上
     **/
    @EasyExcel(fileName = "导出docker 打包数据")
    @Operation(summary = "导出docker 打包")
    @GetMapping("/exportExcel")
    public List<DockerBuilderExcelExport> exportExcel(@ModelAttribute DockerBuilderQueryListCommand dockerBuilderQueryListCommand){
        return dockerBuilderApplication.exportExcel(dockerBuilderQueryListCommand);
    }
    /**
     * describe 导出模版docker 打包
     *
     
     * @return {@link Result<List<DockerBuilderExcelExport>>} docker 打包     
     
     * @author Jia wei Wu
     * @date 2025/07/08 06:06 晚上
     **/

    @EasyExcel(fileName = "导出docker 打包模版数据")
    @Operation(summary = "导出docker 打包模版")
    @GetMapping("/exportTemplateExcel")
    public List<DockerBuilderExcelExport> exportTemplateExcel(){
        return List.of(new DockerBuilderExcelExport());
    }
    /**
     * describe 导入docker 打包
     *
     * @param dockerBuilderExcelImportList 导入docker 打包     
     * @return {@link Result<DockerBuilderExcelImport>} docker 打包     
     
     * @author Jia wei Wu
     * @date 2025/07/08 06:06 晚上
     **/

    @Operation(summary = "导入docker 打包")
    @PostMapping("/importExcel")
    public Result<List<DockerBuilderExcelImport>> importExcel(@RequestExcelBody(name = "multipartFile") List<DockerBuilderExcelImport> dockerBuilderExcelImportList){
        return dockerBuilderApplication.importExcel(dockerBuilderExcelImportList);
    }
}